home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-19 | 4.1 KB | 150 lines | [TEXT/CWIE] |
- //========================================================================================
- //
- // File: RadioGrp.cpp
- // Release Version: $ ODF 1 $
- //
- // Author: Laurent Delamare
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "Form.hpp"
-
- #ifndef RADIOGRP_H
- #include "RadioGrp.h"
- #endif
-
- // ----- Framework Layer -----
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- #ifndef FWSVIEW_H
- #include "FWSView.h"
- #endif
-
- #ifndef FWBUTTON_H
- #include "FWButton.h"
- #endif
-
- #ifndef FWCLUSTR_H
- #include "FWClustr.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_Module_OpenDoc_Commands_defined
- #include <CmdDefs.xh>
- #endif
-
- #ifndef SOM_Module_OpenDoc_StdProps_defined
- #include <StdProps.xh>
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- #ifndef SOM_ODDispatcher_xh
- #include <Disptch.xh>
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwgadgts
- #endif
-
- FW_DEFINE_CLASS_M1(CRadioGroup, FW_CSuperView)
-
- const FW_ClassTypeConstant LRadioGroup = FW_TYPE_CONSTANT('r','g','r','p');
- FW_REGISTER_ARCHIVABLE_CLASS(LRadioGroup, CRadioGroup, CRadioGroup::Create, FW_CView::Read, CRadioGroup::Destroy, FW_CView::Write)
-
- //========================================================================================
- // CRadioGroup
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CRadioGroup::CRadioGroup
- //----------------------------------------------------------------------------------------
-
- CRadioGroup::CRadioGroup(Environment* ev,
- FW_CSuperView* container,
- const FW_CRect& contentRect,
- ODID viewId,
- const FW_CPoint& extent) :
- FW_CSuperView(ev, container, contentRect, viewId, extent, FW_kNoScrolling),
- fRadioCluster(NULL)
- {
- }
-
- CRadioGroup::CRadioGroup(Environment* ev) :
- FW_CSuperView(ev),
- fRadioCluster(NULL)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CRadioGroup::~CRadioGroup
- //----------------------------------------------------------------------------------------
-
- CRadioGroup::~CRadioGroup()
- {
- // fRadioCluster is deleted when its last radio button is deleted
- }
-
- //----------------------------------------------------------------------------------------
- // CRadioGroup::Create
- //----------------------------------------------------------------------------------------
-
- void* CRadioGroup::Create(FW_CReadableStream& stream, FW_ClassTypeConstant type)
- {
- FW_UNUSED(stream);
- FW_UNUSED(type);
- FW_SOMEnvironment ev;
- return new CRadioGroup(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // CRadioGroup::Destroy
- //----------------------------------------------------------------------------------------
-
- void CRadioGroup::Destroy(void* object, FW_ClassTypeConstant type)
- {
- FW_UNUSED(type);
- CRadioGroup* self = (CRadioGroup*) object;
- delete self;
- }
-
- //----------------------------------------------------------------------------------------
- // CRadioGroup::Flatten
- //----------------------------------------------------------------------------------------
-
- void CRadioGroup::Flatten(Environment* ev, FW_CWritableStream& archive) const
- {
- FW_CSuperView::Flatten(ev, archive);
-
- // To complete: this method should stream out the radio cluster
- FW_DEBUG_MESSAGE("CRadioGroup::Flatten is not completed yet");
- }
-
- //----------------------------------------------------------------------------------------
- // CRadioGroup::InitializeFromStream
- //----------------------------------------------------------------------------------------
-
- void CRadioGroup::InitializeFromStream(Environment* ev, FW_CReadableStream& stream)
- {
- // Read-in the base resource first
- FW_CSuperView::InitializeFromStream(ev, stream);
-
- // Read the radio cluster
- FW_READ_DYNAMIC_OBJECT(stream, &fRadioCluster, FW_CRadioCluster);
- }
-
-
-
-